<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red{
            background-color: lightpink;
        }
        .green{
            background-color: lightgreen;
        }
        .box{
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
    <script src="jquery.min.js"></script>
    <div class="box red">

    </div>

    <script>
        $('.box').click(function () {
            $(this).toggleClass('green')
        })
    </script>
</body>
</html>